package com.learn.web;

import javax.servlet.*;
import java.io.IOException;

public class FilterTwo implements Filter {

    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        Filter.super.init(filterConfig);
    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        System.out.println("filter_two name：" + this.getClass().getName());
        try {
            filterChain.doFilter(servletRequest, servletResponse);
            System.out.println("filter_two_after name：" + this.getClass().getName());
        } finally {
            System.out.println("filter_two_after_try_finally name：" + this.getClass().getName());
        }
        System.out.println("filter_two_after_end name：" + this.getClass().getName());
    }

    @Override
    public void destroy() {
        Filter.super.destroy();
    }

}
